<?php
use app\models\Isp;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
/**
 * @var $this yii\web\View
 * @var $package app\models\Package
 */

$this->title = '添加/修改套餐';
$this->params['breadcrumbs'][] = '物联网卡管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php $form = ActiveForm::begin();?>
<?php echo Html::activeHiddenInput($package, 'id');?>
<?php echo $form->field($package, 'name');?>
<div class="row">
    <div class="col-md-3"><?php echo $form->field($package, 'data')->textInput(['value' => Yii::$app->formatter->asShortSize($package->data)]);?></div>
    <div class="col-md-3"><?php echo $form->field($package, 'price');?></div>
    <div class="col-md-3"><?php echo $form->field($package, 'isp_price');?></div>
    <div class="col-md-3"><?php echo $form->field($package, 'isp')->dropDownList(ArrayHelper::map(ISP::find()->all(), 'id', 'name'), ['prompt' => '选择运营商']);?></div>
</div>

<div class="row">
    <div class="col-md-3"><?php echo $form->field($package, 'xuzhi');?></div>
    <div class="col-md-3"><?php echo $form->field($package, 'type')->radioList(['1'=>'基础包','2'=>'叠加包']);?></div>
    <div class="col-md-3"><?php echo $form->field($package,'length_unit')->dropDownList(['0'=>'月','1'=>'季度(组合)','2'=>'半年(组合)','3'=>'年(组合)','8'=>'季度(90天)','9'=>'半年(180天)','10'=>'年(365天)'],['prompt' => '请选择时长']);?></div>
    <div></div>
</div>
<?php echo $form->field($package, 'remark')->textarea();?>
<div class="form-group">
    <div class="col-lg-offset-1 col-lg-11">
        <button type="button" class="btn btn-default" onclick="window.history.go(-1);"><i class="ace-icon fa fa-arrow-left bigger-110"></i>返回</button>
        <button class="btn btn-primary"><i class="ace-icon fa fa-check bigger-110"></i>保存</button>
        <button type="reset" class="btn btn-warning"><i class="ace-icon fa fa-undo bigger-110"></i>重置</button>
    </div>
</div>
<?php $form->end();?>
